import allure

from base.base_page import BasePage
from locator.bookshelf_page_loc import *


class BookShelfPage(BasePage):
    @allure.step("获取最近阅读按钮文本")
    def get_recent_read_text(self):
        txt = self.get_text(recent_read_loc)
        return txt

    @allure.step("获取书架中所有书籍名称 ")
    def get_book_list_in_bookshelf(self):
        elements = self.locator_elements_with_wait(book_list_loc)
        book_names = [element.text for element in elements]
        return book_names